import Vue from 'vue'
import Router from 'vue-router'
import Login from './components/Login.vue'
import Home from './components/Home.vue'
import Welcome from './components/Welcome.vue'
import Employee from './components/layout/Employee.vue'
import Repair from './components/layout/Repair.vue'
import Inbound from './components/layout/parts/Inbound.vue'
import Outbound from './components/layout/parts/Outbound.vue'
import Bill from './components/layout/orders/Bill.vue'
import Plan from './components/layout/orders/Plan.vue'
import Salary from './components/layout/orders/Salary.vue'

import './assets/css/global.css'

Vue.use(Router)

const router =  new Router({
  routes: [
    // 路由重定向
    { path: '/', redirect: '/home' },
    { path: '/login', component: Login },
    { 
      path: '/home', 
      component: Home, 
      redirect: '/welcome',
      children: [{path: '/welcome', component: Welcome},
                  {path: '/employee', component: Employee},
                  {path: '/repair', component: Repair},
                  {path: '/inbound', component: Inbound},
                  {path: '/outbound', component: Outbound},
                  {path: '/bill', component: Bill},
                  {path: '/plan', component: Plan},
                  {path: '/salary', component: Salary}
                ]
      }

  ]
})


export default router
